xenstore: add explicit memory context parameter to get_parent()
authorJuergen Gross <jgross@suse.com>
Tue, 19 Jul 2016 11:30:43 +0000 (13:30 +0200)
committerWei Liu <wei.liu2@citrix.com>
Tue, 19 Jul 2016 11:56:58 +0000 (12:56 +0100)
commitf304adbd5e1047b36fb64e98ad400fa17084b9cd
treed0d5aa8f8c0dc317843123544a64f4528335d636
parent31b08f76b78a7db101d151a0b0b912c4e974022c
xenstore: add explicit memory context parameter to get_parent()

Add a parameter to xenstored get_parent() function to explicitly
specify the memory context to be used for allocations. This will make
it easier to avoid memory leaks by using a context which is freed
soon.

When available use a temporary context when calling get_parent(),
otherwise mimic the old behavior by calling get_parent() with the same
argument for both parameters.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/xenstore/xenstored_core.c